﻿/*CREATE TRIGGER [dbo].[RiegoSistemas_DeletionTrigger] 
    ON [RiegoSistemas] 
    AFTER DELETE 
AS 
SET NOCOUNT ON 
UPDATE [dbo].[RiegoSistemas_Tombstone] 
    SET [DeletionDate] = GETUTCDATE() 
    FROM deleted 
    WHERE deleted.[SistemaGuid] = [RiegoSistemas_Tombstone].[SistemaGuid] 
IF @@ROWCOUNT = 0 
BEGIN 
    INSERT INTO [dbo].[RiegoSistemas_Tombstone] 
    ([SistemaGuid], DeletionDate)
    SELECT [SistemaGuid], GETUTCDATE()
    FROM deleted 
END*/